<template>
  <el-form label-width="130px">
    <el-form-item label="版权名">
      <el-col :span="5">
        <el-input v-model="copyrightin.copyrightName"/>
      </el-col>
    </el-form-item>
    <el-form-item label="公司名">
      <el-col :span="5">
        <el-input v-model="copyrightin.companyName"/>
      </el-col>
    </el-form-item>
    <!-- TODO 分类 -->
    <!-- TODO 版权 -->
    <!-- TODO 批次 -->
    <!-- TODO 书单 -->
    <el-form-item label="合作状态">
      <el-select v-model="copyrightin.status" clearable placeholder="请选择">
        <el-option :value="1" label="生效"/>
        <el-option :value="0" label="失效"/>
      </el-select>
    </el-form-item>
    <el-form-item label="备注名">
      <el-col :span="5">
        <el-input v-model="copyrightin.remarkName"/>
      </el-col>
    </el-form-item>
    <el-form-item label="版权简介">
      <el-input v-model="copyrightin.introduction" :rows="10" type="textarea"/>
    </el-form-item>
    <!-- TODO 书封 -->
    <el-form-item>
      <el-button :disabled="saveBtnDisabled" type="primary" @click="saveCopyrightin()">保存</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
  import copyrightin from '@/api/copyrightin/copyrightin.js'
    export default {
      data(){
        return {
          copyrightin: {},
          saveBtnDisabled: false,
          BASE_API: process.env.VUE_APP_BASE_API
        }
        },
          created(){

        },
      methods:{
        saveCopyrightin() {
          this.saveBtnDisabled = true // ##禁用保存按钮
          copyrightin.saveCopyrightin(this.copyrightin)
            .then(response => {
              // ## 提示信息
              this.$message({
                type: 'success',
                message: '添加成功!'
              })
              // ## 回到list页面,重定向功能
              this.$router.push('/copyrightin/copyrightin/list')
            })
        }

      }
    }
</script>

<style scoped>

</style>
